<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Categories model
 *
 * @package		PyroCMS
 * @subpackage	Categories Module
 * @category	Modules
 * @author		Phil Sturgeon - PyroCMS Dev Team
 */
class Escort_ads_zones_m extends MY_Model
{

	/**
	 * Callback method for validating the title
	 * @access public
	 * @param string $category The title to validate
	 * @return mixed
	 */
	public function check_code($code = '')
	{
		return parent::count_by('code', $category) > 0;
	}
	
	/**
	 * Insert a new category into the database via ajax
	 * @access public
	 * @param array $input The data to insert
	 * @return int
	 */
	public function insert_ajax($input = array())
	{
		$this->load->helper('text');
		return parent::insert(array(
			'category'=>$input['category']
		));
	}
}